package com.yk.silence.rxmvp.base;

import android.app.Application;

import com.yk.silence.rxmvp.common.AppLifeCycleCallBack;

public class APP extends Application {

    private static APP mApp = null;

    @Override
    public void onCreate() {
        super.onCreate();
        // AppLifecycleCallback 实现 ActivityLifecycleCallbacks 接口方法
        this.registerActivityLifecycleCallbacks(new AppLifeCycleCallBack());
    }

    private APP() {
    }

    /**
     * 单例
     *
     * @return
     */
    public static APP getInstance() {
        if (mApp == null) {
            synchronized (APP.class) {
                if (mApp == null) {
                    mApp = new APP();
                }
            }
        }
        return mApp;
    }


}
